import App from './App.vue'
import uvUI from '@/uni_modules/uv-ui-tools'
import plugins from './plugins' // plugins
import naive from 'naive-ui'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import Antd from 'ant-design-vue';

import 'element-plus/dist/index.css'
import 'ant-design-vue/dist/antd.css';
// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import * as Pinia from 'pinia';
import Vant from 'vant';
import 'vant/lib/index.css';
import miniChat from '@/uni_modules/mini-chat/components/mini-chat/mini-chat.vue'

export function createApp() {
	const app = createSSRApp(App)
	for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
		app.component(key, component)
	}

	app.use(Antd);
	app.use(Vant);
	app.use(Pinia.createPinia())
	app.use(uvUI)
	app.use(plugins)
	app.use(ElementPlus)
	app.use(naive)
	app.use(miniChat)
	// app.use(router);
	return {
		app,
		Pinia, // 此处必须将 Pinia 返回
	}
}
// #endif